import request from '@/utils/request';

// 商品管理
export const goodsList = (data) => {
  return request({
    url: '/shop/goods/index',
    method: 'POST',
    data,
  })
}
//添加商品需要展示数据
export const addDetail = (data) => {
  return request({
    url: '/shop/goods/addDetail',
    method: 'POST',
    data,
  })
}
// (添加/修改)商品
export const goodsSave = (data) => {
  return request({
    url: '/shop/goods/save',
    method: 'POST',
    data,
  })
}
// 导出商品管理
export const exportGoods = (data) => {
  return request({
    url: '/shop/goods/exportGoods',
    method: 'POST',
    responseType: 'blob',
    data,
  })
}
// 导出商品管理
export const editDetail = (data) => {
  return request({
    url: '/shop/goods/editDetail',
    method: 'POST',
    data,
  })
}
// 删除
export const deleteGoods = (data) => {
  return request({
    url: '/shop/goods/delete',
    method: 'POST',
    data,
  })
}
// 上下架
export const editStatus = (data) => {
  return request({
    url: '/shop/goods/editStatus',
    method: 'POST',
    data,
  })
}
// 平台商品搜索
export const goodsSearchList = (data) => {
  return request({
    url: '/shop/goods/plat',
    method: 'POST',
    data,
  })
}
// 申请新品列表
export const goodsApplyList = (data) => {
  return request({
    url: '/shop/goods/applyList',
    method: 'POST',
    data,
  })
}
// 申请新品详情
export const applyGoodsDetail = (data) => {
  return request({
    url: '/shop/goods/applyGoodsDetail',
    method: 'POST',
    data,
  })
}
// 申请新品删除
export const applyGoodsDelete = (data) => {
  return request({
    url: '/shop/goods/applyGoodsDelete',
    method: 'POST',
    data,
  })
}
// 申请新品提交
export const applyGoods = (data) => {
  return request({
    url: '/shop/goods/apply',
    method: 'POST',
    data,
  })
}
// 心愿单排行
export const collectRanking = (data) => {
  return request({
    url: '/shop/goods/collectRanking',
    method: 'POST',
    data,
  })
}
// 爆款商机
export const goodsHot = (data) => {
  return request({
    url: '/shop/goods/hot',
    method: 'POST',
    data,
  })
}
// 商品对应优惠券
export const listCoupon = (data) => {
  return request({
    url: '/shop/goods/listCouponConfig',
    method: 'POST',
    data,
  })
}